<html>
<head>
<#include "common.ftl">
    <title>药品管理</title>
    <script type="text/javascript" src="${ctx}/js/common.js"></script>
    <script type="text/javascript" src="${ctx}/js/base.js"></script>
    <script type="text/javascript" src="${ctx}/js/drug.js"></script>

</head>

<body>
<table id="dg" class="easyui-datagrid" pagination=true
       toolbar="#tb" fit=true
       url="${ctx}/user/drug/queryDrugByParams">
    <thead>
    <tr>
        <th field='id' checkbox=true></th>
        <th field='drugname'>药品名称</th>
        <th field='drugid'>药品编号</th>
        <th field="drugtype" formatter="formatterDrugType">药品类型</th>
        <th field='drugnum'>药品数量</th>
        <th field="saleprice">售价</th>
        <th field='guaranteePeriod'>保质期</th>
        <th field='produceDate' formatter="formatterDate">生产日期
        </th>
        <th field='producer'>生产商</th>
        <th field='createdate' formatter="formatterDate">创建时间</th>
        <th field='updatedate' formatter="formatterDate">更新时间</th>
        <th field='isvalid' formatter="formatterIsValid">药品状态</th>
    </tr>
    </thead>
</table>
<div id="tb">
    <a href="javascript:openAddDrugDialog()" class="easyui-linkbutton"
       plain=true iconCls="icon-save">添加</a>
    <a href="javascript:openModifyDrugDialog()" class="easyui-linkbutton" plain=true iconCls="icon-edit">修改</a>
    <a href="javascript:deleteDrug()" class="easyui-linkbutton" plain=true iconCls="icon-remove">删除</a>
    <br/>
    <!-- 搜索条件配置 -->
    药品名称:<input type="text" name="drugName" id="drugName"/>
    药品类型：<select id="drugType" class="easyui-combobox" name="drugType" style="width:200px;"
                 panelHeight="auto">
    <option value="">全部</option>
    <option value="0">中药</option>
    <option value="1">西药</option>
</select>
    状态: <select id="isvalid" class="easyui-combobox" name="type" style="width:200px;"
                panelHeight="auto">
    <option value="">全部</option>
    <option value="0">失效</option>
    <option value="1">正常</option>
</select>
    <a href="javascript:searchDrugByParams()" class="easyui-linkbutton"
       iconCls="icon-search">搜索</a>`
</div>


<div id="dlg" class="easyui-dialog" style="width: 400px;height: 300px"
     closed=true buttons="#bt">

    <form id="fm" method="post" >
        生产厂商:<input name="producerid" type="text" required="required"/> <br/>
        药品名称:<input name="drugname" type="text" required="required"/><br/>
        药品编号:<input name="drugid" type="text" required="required"/><br/>
        药品类型:<input name="drugTypeStr" type="text" required="required"/><br/>
        药品数量:<input name="drugnum" type="text" required="required"/><br/>
        出售价格:<input name="saleprice" type="text" required="required"/><br/>
        收购价格:<input name="buyprice" type="text" required="required"/><br/>
        保存日期:<input name="guaranteePeriod" type="text" required="required"/><br/>
        生产日期:<input name="produceDateStr" type="text" class="easyui-datebox" required="required"/><br/>

        <input name="id" id="id" type="hidden"/>
    </form>
</div>

<div id="bt">
    <a href="javascript:saveOrUpdateAccount()" class="easyui-linkbutton" iconCls="icon-save">保存</a>
    <a href="javascript:closeDlg()" class="easyui-linkbutton" iconCls="icon-cancel">关闭</a>
</div>
</body>
</html>